<template>
	<view class="orderCard">
		<view class="">
			<view class="dataList">
				<view class="dataList_title">
					<text>费用明细</text>
				</view>
				<view class="technicianList" >
					<view class="flexjsbac technicianName">
						<text>项目金额 
							<text class="additional">技师×{{ technicianNum }}</text>
						</text>
						<text>￥{{ technicianMoney }}</text>
					</view>
					<view class="flexjsbac technicianName">
						<text>包间费</text>
						<text>￥{{ orderDetail.compartmentMoney || 0 }}</text>
					</view>
					<view class="flexjsbac technicianName" v-for="(item, index) in orderDetail.zyOrderProductList" :key="index">
						<text>{{ item.productNum }}</text>
						<text>+￥{{ orderDetail.originalPrice || 0 }}</text>
					</view>
					<view class="flexjsbac technicianName">
						<text>会员权益</text>
						<text>￥{{ item.discountsMoney || 0 }}</text>
					</view>
					<!-- <view class="coupon-box">
						<view class="coupon-item">
							<text class="item-label">
								平台优惠券
								<text class="name">{{ orderDetail.platformZyUserCoupon.name }}</text>
							</text>
							<text class="item-value">￥{{ orderDetail.platformZyUserCoupon.discountAmount || 0 }}</text>
						</view>
						<view class="coupon-item">
							<text class="item-label">
								区域优惠券
								<text class="name">{{ orderDetail.regionUserCoupon.name }}</text>
							</text>
							<text class="item-value">￥{{ orderDetail.regionUserCoupon.discountAmount || 0 }}</text>
						</view>
						<view class="coupon-item">
							<text class="item-label">
								店铺优惠券
								<text class="name">{{ orderDetail.storeZyUserCoupon.name }}</text>
							</text>
							<text class="item-value">￥{{ orderDetail.storeZyUserCoupon.discountAmount || 0 }}</text>
						</view>
					</view> -->
				</view>
				<view class="flexjeac" style="height: 100%;padding: 0 24rpx 24rpx;">
					<text>实付款：</text>
					<text style="color: #FE4D4F;">￥{{ orderDetail.actuallyMoney }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'OrderCard',
		data() {
			return {
				technicianMoney: 0,
				technicianNum: 0
			}
		},
		props: {
			orderDetail: {
				type: Object,
				default: {}
			}
		},
		watch: {
			orderDetail: {
				handler(newVal, oldVal) {
					newVal.zyOrderItemList.forEach(item => {
						this.technicianMoney += Number(item.paymentMoney)
					})
					this.technicianNum = newVal.zyOrderItemList.length
				},
				deep: true
			}
		},
		created() {
		},
		methods:{
			clickItem(item) {
				uni.navigateTo({
					url:`/subPages/order/orderDetail`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.orderCard{
		margin: 30rpx;
		.dataList{
			margin-bottom: 30rpx;
			background: #fff;
			border-radius:17rpx;
			.dataList_title{
				font-size: 32rpx;
				font-weight: 600;
				color: #333333;
				border-bottom: 1px solid #E6E6E6;
				padding: 24rpx;
			}
			.technicianList{
				padding: 20rpx 30rpx;
				.flexjsbac{
					height: 67rpx;
					opacity: 1;
					border-bottom: 1rpx solid #E6E6E6;
					font-size: 30rpx;
					font-weight: 500;
					color: #666666;
					text-align: left;
					vertical-align: top;
					.additional{
						font-size: 28rpx;
						font-weight: 400;
						color: #666666;
						margin-left: 10rpx;
					}
				}
			}
		}
	}
	.coupon-box {
		margin: 20rpx 0;
		padding: 20rpx 30rpx;
		border-radius: 16rpx;
		background-color: #f9f9f9;
		.coupon-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 67rpx;
			border-bottom: 2rpx solid #E6E6E6;
			font-size: 30rpx;
			font-weight: 500;
			color: #666666;
			&:last-child {
				border-bottom: none;
			}
			.item-label {

			}
			.name {
				margin-left: 20rpx;
			}
		}
	}
</style>